// 获取验证码
// import { from } from 'core-js/core/array'
import request from '@/utils/request.js'
// import axios from 'axios'

export const getPicCode = () => {
  // console.log()
  // const res = await axios.get('http://smart-shop.itheima.net/index.php?s=/api/captcha/image')
  // console.log(res)
  return request.get('/captcha/image')
}

export const getmessage = (captchaCode, captchaKey, mobile) => {
  return request.post('/captcha/sendSmsCaptcha', {
    platform: 'H5',
    form: {
      captchaCode,
      captchaKey,
      mobile
    }
  })
}

export const codeLogin = (mobile, smsCode) => {
  return request.post('/passport/login', {
    // Header: { platform: 'H5' },
    form: {
      isParty: false,
      partyData: {},
      mobile,
      smsCode
    }
  })
}
